<%@page import="databank.DataBank"%>
<%@page import="databank.DatabankVo"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>modify.jsp</title>
<script>
function btnList(){
	location.href="index2.jsp?inc_content=./databank/list.jsp";
	
}
function fileDel(serial,filename){
	var f= confirm("정말 삭제하시겠습니까?");
	if(f){
		location.href='index2.jsp?inc_content=./databank/fileDel.jsp&serial='+serial+"&filename="+filename;
		
	}else{
		alter("삭제가 취소되었습니다.");
	}
}

</script>
</head>
<body>
<jsp:useBean id="bankVo" class="databank.DatabankVo" />
<jsp:setProperty property="*" name="bankVo"/>
<%

DataBank bank = new DataBank();
bank.setVo(bankVo);
DatabankVo vo= bank.view();


%>



<h1>파일 업로드 수정</h1>
<form id='Modify_frm' action='index2.jsp?inc_content=./databank/modify_result.jsp' method='post' enctype='multipart/form-data'>
<div>작성자: <input type="search" name='mid' readonly value="<%=vo.getMid()%>"></div>
<div>비밀번호: <input type="password" id='pwd' name="pwd"></div>
<label>제목: </label><input type='search' name='subject' size='70' value="<%=vo.getSubject()%>"><br/>
<div>내용: <textarea  name='content' rows='5' cols='68'><%=vo.getContent() %></textarea></div>
<div>파일명: <input type="file" id='filename' name='filename'></div>



<%if(vo.getFilename()==null || vo.getFilename().equals("")){ %>
<input type='file' name='newfilename'>
<%}else{ %>
<%=vo.getFilename()%>
<input type='button' value='삭제' onclick="fileDel(<%=vo.getSerial() %>,'<%=vo.getFilename()%>')">

<% }%>


<input type="hidden" name="serial" value='<%=vo.getSerial() %>'/>

<div><input type="submit" value="확인"> <input type="button" value="목록" onclick="btnList()"> </div>
</form>
</body>
</html>